function [x_n dx dy]= UniformGrid2D(Nx, Ny, Lx, Ly, centre)
% [x_n]= UniformGrid2D(Nx, Ny, Lx, Ly, centre)
% function to build points in an 'uniform grid' arrangment, but in a very easy fashion.
% 
% Nx    : number of nodes in x's direction
% Ny    : number of nodes in y's direction
% Lx    : the length of the mesh in x.
% Ly    : the length of the mesh in y.
% centre: coordinates of the mesh geometric centre

%the origin is the first point (to avoid duplication is outside of the loop)

dx = Lx/(Nx-1);
dy = Ly/(Ny-1);

Lx = 0.5*Lx - centre(1);
Ly = 0.5*Ly - centre(2);

x_n=zeros(Nx*Ny,2);

ptId = 1;
for i=0:Ny-1
  y= i*dy - Ly;
  for j=0:Nx-1
    x_n(ptId,1) = j*dx - Lx;
    x_n(ptId,2) = y;
    ptId = ptId+1;
  end
end